package com.ruiysoft.controller.mdse.vo;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.validation.annotation.Validated;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

/**
 * SpuDtoVo
 */
@Validated
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2018-11-17T14:02:36.494+08:00")

public class SpuDtoVo   {
  @JsonProperty("spuId")
  private Long spuId = null;

  @JsonProperty("categoryId")
  private Long categoryId = null;

  @JsonProperty("spuName")
  private String spuName = null;

  @JsonProperty("type")
  private Integer type = null;

  @JsonProperty("info")
  private String info = null;

  @JsonProperty("skus")
  @Valid
  private List<SkuVo> skus = new ArrayList<SkuVo>();

  @JsonProperty("photos")
  @Valid
  private List<SpuPhoto> photos = new ArrayList<SpuPhoto>();

  @JsonProperty("status")
  private Integer status = null;

  @JsonProperty("RuleValues")
  @Valid
  private List<RuleValueVo> ruleValues = new ArrayList<RuleValueVo>();

  public SpuDtoVo spuId(Long spuId) {
    this.spuId = spuId;
    return this;
  }

  /**
   * Get spuId
   * @return spuId
  **/
  @ApiModelProperty(example = "1", value = "")


  public Long getSpuId() {
    return spuId;
  }

  public void setSpuId(Long spuId) {
    this.spuId = spuId;
  }

  public SpuDtoVo categoryId(Long categoryId) {
    this.categoryId = categoryId;
    return this;
  }

  /**
   * 分类id
   * @return categoryId
  **/
  @ApiModelProperty(example = "1", value = "分类id")


  public Long getCategoryId() {
    return categoryId;
  }

  public void setCategoryId(Long categoryId) {
    this.categoryId = categoryId;
  }

  public SpuDtoVo spuName(String spuName) {
    this.spuName = spuName;
    return this;
  }

  /**
   * Get spuName
   * @return spuName
  **/
  @ApiModelProperty(example = "doggie", required = true, value = "")
  @NotNull


  public String getSpuName() {
    return spuName;
  }

  public void setSpuName(String spuName) {
    this.spuName = spuName;
  }

  public SpuDtoVo type(Integer type) {
    this.type = type;
    return this;
  }

  /**
   * 商品类型（1，普通商品，2，虚拟商品（不需要收货地址））
   * @return type
  **/
  @ApiModelProperty(required = true, value = "商品类型（1，普通商品，2，虚拟商品（不需要收货地址））")
  @NotNull


  public Integer getType() {
    return type;
  }

  public void setType(Integer type) {
    this.type = type;
  }

  public SpuDtoVo info(String info) {
    this.info = info;
    return this;
  }

  /**
   * 商品详情介绍
   * @return info
  **/
  @ApiModelProperty(example = "doggie1234", value = "商品详情介绍")


  public String getInfo() {
    return info;
  }

  public void setInfo(String info) {
    this.info = info;
  }

  public SpuDtoVo skus(List<SkuVo> skus) {
    this.skus = skus;
    return this;
  }

  public SpuDtoVo addSkusItem(SkuVo skusItem) {
    this.skus.add(skusItem);
    return this;
  }

  /**
   * spu下sku列表
   * @return skus
  **/
  @ApiModelProperty(required = true, value = "spu下sku列表")
  @NotNull

  @Valid

  public List<SkuVo> getSkus() {
    return skus;
  }

  public void setSkus(List<SkuVo> skus) {
    this.skus = skus;
  }

  public SpuDtoVo photos(List<SpuPhoto> photos) {
    this.photos = photos;
    return this;
  }

  public SpuDtoVo addPhotosItem(SpuPhoto photosItem) {
    this.photos.add(photosItem);
    return this;
  }

  /**
   * spu图片（包括详情图片）
   * @return photos
  **/
  @ApiModelProperty(required = true, value = "spu图片（包括详情图片）")
  @NotNull

  @Valid

  public List<SpuPhoto> getPhotos() {
    return photos;
  }

  public void setPhotos(List<SpuPhoto> photos) {
    this.photos = photos;
  }

  public SpuDtoVo status(Integer status) {
    this.status = status;
    return this;
  }

  /**
   * 上下架状态（1，上架，2，下架）
   * @return status
  **/
  @ApiModelProperty(required = true, value = "上下架状态（1，上架，2，下架）")
  @NotNull


  public Integer getStatus() {
    return status;
  }

  public void setStatus(Integer status) {
    this.status = status;
  }

  public SpuDtoVo ruleValues(List<RuleValueVo> ruleValues) {
    this.ruleValues = ruleValues;
    return this;
  }

  public SpuDtoVo addRuleValuesItem(RuleValueVo ruleValuesItem) {
    this.ruleValues.add(ruleValuesItem);
    return this;
  }

  /**
   * spu拥有规格-规格值
   * @return ruleValues
  **/
  @ApiModelProperty(required = true, value = "spu拥有规格-规格值")
  @NotNull

  @Valid

  public List<RuleValueVo> getRuleValues() {
    return ruleValues;
  }

  public void setRuleValues(List<RuleValueVo> ruleValues) {
    this.ruleValues = ruleValues;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    SpuDtoVo spuDtoVo = (SpuDtoVo) o;
    return Objects.equals(this.spuId, spuDtoVo.spuId) &&
        Objects.equals(this.categoryId, spuDtoVo.categoryId) &&
        Objects.equals(this.spuName, spuDtoVo.spuName) &&
        Objects.equals(this.type, spuDtoVo.type) &&
        Objects.equals(this.info, spuDtoVo.info) &&
        Objects.equals(this.skus, spuDtoVo.skus) &&
        Objects.equals(this.photos, spuDtoVo.photos) &&
        Objects.equals(this.status, spuDtoVo.status) &&
        Objects.equals(this.ruleValues, spuDtoVo.ruleValues);
  }

  @Override
  public int hashCode() {
    return Objects.hash(spuId, categoryId, spuName, type, info, skus, photos, status, ruleValues);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class SpuDtoVo {\n");

    sb.append("    spuId: ").append(toIndentedString(spuId)).append("\n");
    sb.append("    categoryId: ").append(toIndentedString(categoryId)).append("\n");
    sb.append("    spuName: ").append(toIndentedString(spuName)).append("\n");
    sb.append("    type: ").append(toIndentedString(type)).append("\n");
    sb.append("    info: ").append(toIndentedString(info)).append("\n");
    sb.append("    skus: ").append(toIndentedString(skus)).append("\n");
    sb.append("    photos: ").append(toIndentedString(photos)).append("\n");
    sb.append("    status: ").append(toIndentedString(status)).append("\n");
    sb.append("    ruleValues: ").append(toIndentedString(ruleValues)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }
}

